<template>
	<view class="service_contents">
		<u-subsection style="width: 100%;margin: 0px 0px 16px 0px;" :list="list" :current="activeIndex" @change="sectionChange"></u-subsection>
		<!-- <el-menu style="width: 100%;margin-bottom: 26px;" :default-active="activeIndex" class="el-menu-demo"
			mode="horizontal" @select="handleSelect">
			<el-menu-item index="0">服务条款</el-menu-item>
			<el-menu-item index="1">隐私政策</el-menu-item>
		</el-menu> -->
		<view style="padding: 0 20px;" v-html="content" v-if="activeIndex==0"></view>
		<view style="padding: 0 20px;" v-html="contents" v-if="activeIndex==1"></view>
	</view>
</template>

<script>
	import {
		configKey
	} from "@/api/login.js"
	export default {
		data() {
			return {
				activeIndex: "0",
				content: "",
				contents: "",
				type: "yingpin",
				list: ['服务条款', '隐私政策'],
				activeIndex:0
			}
		},
		mounted() {
			this.info()
		},
		methods: {
			sectionChange(index) {
				this.activeIndex = index;
			},
			handleSelect(key, keyPath) {
				this.activeIndex = key + ''
			},
			info() {
				configKey(this.type).then(res => {
					console.log(res);
					this.content = res.data.configName
					this.contents = res.data.remark
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.service_contents {
		// width: calc(100% - 20px);
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 0px 00px;
	}
</style>
